package com.example.demo2.service.impl;

import com.example.demo2.entity.User;
import com.example.demo2.mapper.UserMapper;
import com.example.demo2.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Override
    public List<User> forgetPwd(Integer userId, String userName, String userQuestion) {
        return userMapper.forgetPwd(userId,userName,userQuestion);
    }

    @Resource
    private UserMapper userMapper;

    @Override
    public User findByUserId(Integer userId , String userPwd) {

        return userMapper.findByUserId(userId,userPwd);
    }

    @Override
    public boolean insert_user(Integer userId,String userName,String userPwd,String userQuestion) {
        return userMapper.insert_user(userId,userName,userPwd,userQuestion);
    }

    @Override
    public List<User> findByUserId_A(Integer userId) {
        return userMapper.findByUserId_A(userId);
    }

    @Override
    public boolean upDateUserPwd(Integer userId, String userPwd){return userMapper.upDateUserPwd(userId,userPwd);}

    @Override
    public boolean upDateUserInformation(Integer userId, String userName,String userEmail,String userBrief){return userMapper.upDateUserInformation(userId,userName,userEmail,userBrief);}


}
